{% block content %}
    {% load static %}
</head>


<style>
.table{
    margin-top: 200px;
}
.project-font{
    margin-top: 20px;
}
.dropbtn {
    background-color: #d8d9d9;
    color: #3c3f41;
    border: none;
    cursor: pointer;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display:none;
    position:relative;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {background-color: #f1f1f1}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: #d8d9d9;
}


.addgroup{
    	background: transparent;
		border: none;
		outline: none;
		background: #e95420;
		padding: 2px 2px;
		cursor: pointer;
		border-radius: 4px;
        margin-bottom: 2px;
        margin-left:600px;
        width: 86px;



}
.addgroup a{
    color: white;
}


</style>
<h1 class="project-font">组</h1>
  {% csrf_token %}
  {% if messages %}
        <script>
            {% for msg in messages %}
                alert('{{ msg.message }}');
            {% endfor %}
        </script>
    {% endif %}
<div class="table">
<button class="addgroup"><a href="/wyh0282/groupcreate/">+&nbsp;创建组</a></button>
<table  border="1" cellspacing="0"bordercolor="#d8d9d9" >
    <tr>
        <th>组名</th>
        <th>描述</th>
        <th>组标识</th>
         <th>&nbsp;Actions</th>
    </tr>
     {% for group in request.session.groups_list.groups %}
         <tr>
         <td style="color: #e95420">{{ group.name }}</td>
        <td>{{ group.description }}</td>
        <td>{{ group.id}}</td>
         <td>
             <div class="dropdown">
                 <div class="dropbtn">管理组</div>
                 <div class="dropdown-content">
                        <a href="{% url 'wyh0282:group_listid' group.id %}" style="color: black">编辑组</a>
                        <a href="{% url 'wyh0282:group_deleteid' group.id %}" style="color: #e95420">删除组</a>
                        <a href="{% url 'wyh0282:group_userid' group.id%}" style="color: black" >管理成员</a>
                        <a href="{% url 'wyh0282:group_adduserid' group.id %}" style="color: black" >添加用户</a>
                        <a href="{% url 'wyh0282:group_adduserid' group.id %}" style="color: #e95420" >删除用户</a>
                 </div>
             </div>
         </td>
    </tr>
{% endfor %}
</table>
</div>

{% endblock %}
